package com.wing.material.controller;


import com.wing.common.utils.JsonResult;
import com.wing.material.entity.request.MaterialCreateRequest;
import com.wing.material.service.MaterialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 畅捷通-材料出库-领料出库
 */
@Validated
@Api(value = "畅捷通-材料出库相关", tags = "#/chanjet/material")
@RestController("MaterialController")
@RequestMapping("material/admin/material")
@RequiredArgsConstructor
public class MaterialController {

    @Resource
    MaterialService purchaseService;

    /**
     * 保存 领料出库 单
     */
    @ApiOperation(value = "保存领料出库单", notes = "保存")
    @PostMapping("/syncAddMaterialDispatch")
    public JsonResult syncAddMaterialDispatch(@RequestBody MaterialCreateRequest materialCreateRequest) {
        return JsonResult.success(purchaseService.syncAddMaterialDispatch(materialCreateRequest));
    }



}
